﻿@{
    ViewBag.Title = "WorkContentForm";
    Layout = "~/Views/Shared/_Form.cshtml";
}
 
<script>
    var Id = "@Guid.NewGuid().ToString()";
    var keyValue = request('keyValue');
    $(function () {
        //获取表单 
        if (!!keyValue) {
            debugger;
            var rowdata = top.frames["WorkItemForm"].$("#gridTable").jqGridRow()[0];
            $("#form1").SetWebControls(rowdata); 
        }
        else {
            $("#Id").val(Id);
        }
    })
    //保存表单
    function AcceptClick() {
        if (!$('#form1').Validform()) {
            return false;
        }
        var $gridTable = top.frames["WorkItemForm"].$("#gridTable");
        var postData = $("#form1").GetWebControls(""); 
        if (!!keyValue) {
            $gridTable.setRowData(keyValue, postData);
        } else {
            $gridTable.addRowData(($gridTable.jqGrid("getRowData").length + 1), postData);
        }
        dialogMsg("操作成功。", 1);
        dialogClose();
    }
</script>
<div>
    <div style="height:10px;"></div>
    <table class="form"style="width:90%;">
        <tr hidden>
            <td class="formTitle">Id</td>
            <td class="formValue"><input id="Id" type="text" class="form-control" /></td>
        </tr>
        <tr>
            <td class="formTitle">序号</td>
            <td class="formValue"><input id="Sort" type="text" class="form-control"  /></td>         
        </tr>
        <tr>
            <td class="formTitle" valign="top">要点</td>
            <td class="formValue">
                <textarea id="Title" style="height: 80px;" class="form-control"></textarea>        
        </tr>
        <tr>
            <td class="formTitle" valign="top">说明</td>
            <td class="formValue" >
                <textarea id="Memo" style="height: 80px;" class="form-control"></textarea>
           </td>
        </tr>
       
      
    </table>
</div>
